Update sketch function.