Working on fixing flattening