State machine code should be working now. Need to intergrate with calculation code to test with event inputs.