Scripts update

added modularity, greatly due to Doug's contribution :)