add addToList and PrintList functions and tested successfully