Added play encode and decode