passing tests 1-17. refactored struct node/metadata into 1