improve echo example script
refactor simple quicksort example