changed checkwin and added method getAvailMoves()