Added a large amount of comments to the file summarizing distance checking