Got sorting working