find the categories from closest to furthest