fixed indexing issue.  renamed variable