first attempt to create a recursive set of queries