Removed 'for i in' and replaced with regular for loop.