dynamic allocation of chi with tof size