added set/get for Node and code was rearranged