btw, two of the functions get chopped out of the code, one of them has a very long parameter list one to a line, and another one with a break. I used grep \($ to isolate them so I could manually add their parameters.
Yeah, so many pipes is just an easy way to build up the correct substitutions and filters bit by bit until you have the right lines coming out.