Extra Credit

- Changed if else to a switch.
- Removed an error that cause in infinite loop.