consider renaming "counter" to "edge" for clarity