Added snap to DOM functionality