w.i.p sorting functionality