Changed from if/else to a dictionary look-up