slightly more pythonic syntax for iterating over line numbers