prepare for castling code