changing the query allSolutions method to make use of findall/3 instead of iterating with hasNext() and next() methods. Other minor changes.