Another early version of a script that will be encorporated into full pipeline