add printn function, modify main to work with it