Additional comments were added for further explanation.