Flat detection