changing putchar func to inline