add support for multiple groupings
conflict
fix some basic mistakes
do it smarter