main.cpp complete