Added working impl of group-by.