Wrote up the explanation of the code