Tidy/Changed to switch statement. See #17