Added a few comments to simplify understanding