still fixing write and read bugs