done up to indexJ