adding a lost piece of code for stim generation