Exchanged if's with switch statement.