inserted comments to make it easier to follow the code and methods