Updated Query1.java