Prolog day two problem 1