redesign dataset and redefine error and cost