cleaned up write and read, most obvious bugs are gone... can read and
write over a chain.