Implemented castling and better move handling