Codeword Assignment For Cell-Write Reduction In Non-Volatile Memory Technologies