Added snapping to the grid