dded changes for New design and a fix with Query.java