changed updateState() to one giant if-else structure