Added a function to get the weight from a node.
Done some stuffs.