add grid and offset