Added documentation for groupBy method