Replace all the if's with a select case
Merge pull request #1 from JeffLego/patch-1

Replace all the if's with a select case