simplified ifs
pep8 fix