Add printf function; Using printf instead of print_to_consle directly