add createFile and checkFile functions