added my own implementation of the equations of motion