Added encode