flatten out cpu_box
convert neighbors to flat array