Encoding now works