created totalCost and deposit functions on NewController