Added encode script