added method to generate output file path