Added function to add a node between two nodes