Finished castling implementation.