added collisionRectangle formula