Re-factored the code that computes the Physics of collision