Adding code for simplification using edge collapse