Conversion to linear indexing