Split game logic and helper functions - Impossible moves now blocked