toying with an prolog implementation following reasoned schemer