fix to be idiomatic Python