work on selection, autocomplete, fix for an infinite loop glitch