Making progress.  The linked list gets updated in the correct order for most commands now.