Better way to initialize the position of nodes