bug fix, no ternaries in python