shell for query b