stuff for normalizing flat