added flag counts to polys (incomplete)