use extend instead of append twice