Added isLegal Function

Checks various parameters for each move.