Added encode declaration and code format.