Code for alchemy in java