Use extend instead of append. Minor change.