ranking & sorting (kinda works)