yes, copied from groupby-key evaluation... let me re-pos it to a util class.