adding singlepoint and nearest scripts