Created copyandlogFile and logError. Moved some code around. Still need to add logic for Update Letters