final version, use asynchronous writeFile and the callback function checks the file and prints the checks
final version, deleted require async