a better read/write scheme