Altered the physics engine

Altered the physics engine so that it now supports Threads properly