Problem 2 prolog