Removed two for loops