Encoding works
Make encode and decode static