added num2char, updated main.c