corrected stimFile generation