Calculating distance using speed and time