Added function to iterate over characters for use in checking file names