added all the rules in prolog