So at first glance it looks like you're overwriting the variable holding the initial day. I haven't looked at the code at all though, but the increments and decrements all appear correct based on the previous answer.