Added cost functionality