encodes correctly