Added a few comments to make more readable