Using day two knowledge and things I'd forgotten about prolog