Made a nodecreator function to get neighbors