Add argument for location of working directory
Remove obsolete code
Replace hardcoded path with the path specified in argument
Remove extra whitespace from script