added gui parameter to state_changed method
created state object to hold all values that were previously params
created alternate constructor for state class that would take no params. (Commented out)