fixing the parabolic collsion C++