corrected alg
shuffling of neighbour nodes