fixed not to generate minus cost values