working version using startWith to compare