added castle function to play