Added output display and fixed pdf generation