added more nice comments to improve understanding of the methods