Try using enumerate in parsing, more pythonic