fixed gi() to work with our 1D data