Made snap to grid work