added support for file reading