keysearch is used in this block of code multiple times, I wanted it to be consistent. Should we replace all keysearch occurences in the code then? :)