Rewrite the entire physics engine