Use inject for summation.
Replace 'if if if, ...' to case-when in get_group
Merge #11