added states to switch statement