Racing game

need help with the following things in my racing game…
-lap count
-barrier hit tests