switched the iterator because I have no idea what I was thinking before