created a 'neighbor' function for my array2d class