added code to check if Mode and txt files were read correctly