added documenct grid and snap to grid