not sure how many element this can contain, and how often it's called, but should probably switch to a normal FOR loop for performance.