Modified codes to adapt to the tuple modfication