Almost done with Q2 in Java, only debug left.