add read/write - working version