Added convertTo function.