Added method to create a file with contents