Fixed wrong execution in executing main method (homework3.cpp)