Created dynamic cost function

different rates for different amounts of hours