Third sort attempt