Started implementation of non-recursive search function.