Adding move checking to ensure moves are valid.