Transform stream

Ran through my beautifier so I screwed up your style, but you get the idea.