Index sorted array in a better way

This ugly line had to be removed since i learned a better way :)