Let us go through the code line-by-line