Added debug flag and changed load_cookie to if
Disabled saving states
Added checking last two states
Added comparable, <=>, sum_value and under_limit methods