Fixed looping problem using enumerate
Code does compile