[WIP] output handling. See #7