Speed calculation corrected