reposition dropdown as the user types, refactor match chars algorithm