Improved slowdown code to now correctly calculate distance and new speed.