renamed params and fixing a bug in search.R