working ifnish and semi working write
fix read