query and measurement functionaly