Addition to search server costs
added stop condition