Added filter edges function