Added comments to detection script
More changes to distance test script