Moved the collisionBox updating to a method.