Problem now modularized: read and print functions moved to separate files and imported via require()