calculate neighbor indices tested and working