Sort:  

Pretty solid logic there. I like it!