Fixed for loops. Removed arrays