first working version of update neighbours