Changed ridiculous if/else to a switch