Fixes #4

Changed the wall of if statements to a dictionary lookup instead.