translation to Java seems complete