Added support for text files and added documentation