Implemented printing output graphs to files.