modified Z.java