Simplified while loop as a with statement

No need to initially set lnr to zero. This is done by the enumerate() function/iterator