printing function to printing lib