generating list moved to function genearte_list