Added some variables for state logic
Added switch statement for state logic

Commented out test code. Might want to make separate c file for state
logic later?