Merge pull request #2 from curriedav/master

Changes 'if' statement to a 'switch' statement.