updated queries to work with new tables
time field in tables wasn't working. Fixed
added some TODO and bug info