Initial solution at making linked lists for each depth of a tree