clean code with distance being calculated for every 5 seconds and updating the ui stop and start option given to the user