started castling function not fully functional