Added some comments to make debugging easier.