added encode