separating display and generate_png