made it more pythonic