some code with a working sort