Copied in files from elsewhere to prepare for the time delay model