added switch statement parsing