basic encode working on decode