added the first paragraphs for the section on the cost function