Added commits to the function previous commited to help the understanding.