Instaindex vectorized function