fixed bug where all legal moves would return moves that were not available to the piece either because the game was over or because it was not the piece's turn.