1) Moved the 'algorithm' inside the try block
2) Added timestamp to check the speed in seconds