fix errors in nearestDSmax
change formating
test with simple graph
use a new method of passing multidimensional arrays to supress warnings