Merge pull request #2482 from neilLasrado/fix-cost

Fixed cost calculation Error