grouping now works. tons of boilerplate to be refactored