Update main.cpp

Removed methods and just implemented in main(), resorted in less lines of code and full functionality.