rewrite for box2dweb