Modified the arguments to root the input and output paths with the working directory rather than the program directory.
Simplified the program logic.