almost done. need set search depth limit.