making code shorter
Minor changes and removed wrong implementation of genPercept (not used right now)
fixing conflicts in search.cpp