Update main.cpp

Fixed a bug in the code!