first draft of query module