Even better cost calculation in example