Sorting the beans