added a physics engine
updated code