Updated main.cpp with code from earlier project