creates test for decelerate function and create said function