improved expmax in Java, still not functional