Simplyfied main.cpp