Added CreateLogFile and WriteInFile functions