main.cpp fixed output