Added a commented-out version of the if-else monstrosity that uses switch() instead.