read and write implemented (do we need better lock?)