minor fixes to the scripts, preprocessing working quite well now.