main.cpp updated to print output