adding test and debug mode
intermediate commit, need to fix hr search (perf issue)