Add @nlinear to convert to a linear index