first pass to the end (almost)