still working on buffered read