changed variable names within loops as well