Trying to make a chemistry system in Java