Think the write algorithm is almost there...