Added debug messages, and fixed neighbor/location lists to be in row major order.