WIP add tags / outputs.
Remove self-referencing functions.