add date method and better query functionality