search algorithm with better coverage; still needs a reverse command