Adding, sorting and printing a list implemented