Removed extra for loops after feedback from voineali