main.cpp if statements fix