Encoder for Matt Jadud's class