put more pythonic version in comments