port fancy indexing to c so that we can do it without the gil and thus run the parallel loop