using der to encode things