Added if/else if functionality.