added encode.h