add test_bounds and fix bug in _edges