added some docs, and formated group_by
reverted formating