Rewrote a code according to the original changing.