Collision detection for boxes implemented