allow for negative indices in 1d arrays