I think that these implementations of indexJ and dropJ are correct.