using a proper function to get speed, correct types