Found some big problems in the speeddivide function, I fixed them