added default value printing
refactored to use linked lists