first stub of code. have sparse arrays, need to calc distances