Implementing cost and margin