iterates a collection forward and reverse