add functionf for format print
add comments
change function name logln to log