Yet another re-write, this time let the query to set the proper order

Signed-off-by: Suki <suki@missallsunday.com>
Don't use the same groups for everyone :(

Signed-off-by: Suki <suki@missallsunday.com>