Removed hardcoded file paths and added optional input path argument