Copy encoding from example project. Comment handlers until implemented.