added convertTypes function