Solved 3 problems in main.cpp