Made some if statements more Pythonic
Made some if statements more Pythonic