making new function to remove edges