should be more pythonic now