Add closure and sort