flowchart, because code is crufty