Fixed error in time calculation. Should work now