Exercise 2 - bug fix state cost