minor santify change to original source
changed ii to index for consistency
clarified variable names for trimmed and original lines