Updated the comments to more accurately describe the algorithm