Implemented funciton to add list