new structure/implementation
implement functions with new node structure
fix comments