Implemented castle rules