add customizable length and index funcs for collections