Why are you returning this? This function returns 0,-1 or -3 only. You should also handle out of spec speeds.