fix group min (ready for review)