added method to create a file from a string