Updated main.cpp with comments