exception written, auto tested with text files