Added the nested case ladder flattening