removed mph and simplify code