tested; slight modifications to file paths, args