trying to fix edge counting problems - not fixed