complex query, fix time query, add order, limit, query find

Not sure yet how I am going to format output and find statements that
reference the found statements