added solution to flattening problem