Fixed Group ordering

Should maintain group order now, but uses an n*m algo (total
items*current group items).