Removed unused edge calculation code