move functions to print.h, decrease main file size.