documented main.cpp