Modified output method to handle errors properly
.
.
refactored outputInfo()