A simple sorting mechanism