begin reshaping queries