Added code to read textfile formats.