Update main.cpp

Got rid of unnecessary for loop