first prototype of convert function