Programmaticaly update total cost