changed to be able to add more than 3 nodes