Added getUpdateCode static method.
Fixed sample code.