Added helper functions that the shell scripts call to generate filenames and help withh error checking.