Refactoring checkCollision
Adding directions
Adding matrix direction