Introduce the maxdrift variable.
Add missing semicolons
Fix time logic for first event
Fix format and counter starting point
Cast time comparison as ints
Fix another stupid char* error