Fixing unflat defenition