finished up basic query stuff