Updated Total cost computation