implemented castling, in perhaps the sloppiest way imaginable