Lots of comments to better understand the code.