start of determining lap (not yet working properly)