State machine now working with integers.