Update MapOutput

* Probably more idiomaic use of Stream and pattern matching.