Added some comments and styling.
Fixed bug where pages was printed twice.