Adding index functionality to generator