sorted abstraction