made the recursion to get all results