changed costDataSet to array
fixed cost stuff, is better than Matt's
fixed cost stuff, is better than Matt's again