Oh, I've changed $final_output_path, but I really don't know what is it's purpose and what this changes (seems like it's unused)