grid_offset and grid_centered functions added