Loop through all the possible extension, not just the first one
No need to loop through the rest of the list
Merge pull request #33 from makije/master

Extension