Added method groupBy(), improved documentation