created a node class to hold data for linked list
deallocates memorywhen removing node instead of when adding node