made some changes but confused about how totalcost is used