fixed coordinate conversion.
changed the method of tracking rigid bodies.
removed unnecessary comments.