Changed plotting to be inside a switch statement instead of if statements.