Need Node class to make it work, cannot write algo.