Java calculations for chemistry