Todo list
Changed the order of the for-idx iteration