fixed some havoc - Using 'i' for multiple for loops - no good