add write and read methods