Added flatten to value_stream, modified group_by