Code in Prolog