Changed boolean ifs