Better performance + fixed vertical edges bug and vertices at same
position + implemented grid spacing feature.