more work on sorting, ui tweaks for repl