depth almost working. edges are not being removed