first draft of executing queries