refactoring nodes
updating problem 79