restructured repository. added code for query 6