FP HW12 U-algorithm
Java hw5 fix