used extend(list) instead of for loop