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

Hey Josh,

I saw that you put this up and it was along the same lines of what I was planning to code. This pull request changes the 'if' statement that you use in your assignment to a 'switch' statement that I planned on using. If you like this change, accept the pull request and merge the code.

Thanks,
David C.

PS: Just to be clear, I am not trying to tell you my way is right or steal your work. I am just trying to use the git hub social tool and collaborate.

PPS: I am not sure how to deal with "undefined" at the beginning of the string.