moved functions to Maths
implemented ampholytes