Added snapping to edges