Index fix; more descriptive var names.
More better names; tidying