incomplete 4.8 solve, Java