Substitute update procedure to python implementation

signifcantly improving update performance.