Switched code sample to switch statement.