Initial version of tquery