Pushed sample physics engine, functional version of code