lots of changes, added stalemate and checkmate