refactoring of convertto(), now pointer based (faster)