Partial implementation of indexJ