added math function for converting numbers to another base