Updated print, modified main to use print function