improve documentation, check for files at end of script.