Updated max time between points function
Refactored v1