Update main.cpp

this would be a faster (by roughly 30 seconds) alternative, also less troublesome