added streaming and buffered file-reading