working on implementation of fstream