made a couple quick tweaks to get the read dir to work. Need to go back and optimize the code now that it is working.