fixed multyplyCostTpl