Defined paths and parameters

Hi Mads, I changed a couple of things so that I can use the script for other things, It makes your very useful script generic. Thought I might send these suggestions. My first pull request!