Following along with Curran at https://www.youtube.com/watch?v=2LhoCfjm8R4&t=22532s
Grouping logic from https://vizhub.com/curran/2546209d161e4294802c4ac0098bebc2?edit=files&file=index.js