simple conditional fold of if/else if