fixing motor speed calculator