clean up
use mutable `seen` instead
temp