Flattening variables