initialize arrays with zeros
use the fabs function to determine the max speed