fixed induction -- counter variable outside of loop, needed to be inside