start tail recursion
apply peephole optimization
working on translation of search to functional form