add basic implementation of cross indexes javascript