Found a potential bug, and highligted it with TODO
Using list.extend instead of looping over and appending each element