lap counter and bug fixes