Fixed problem with how cost was being calculated.