Added variable for extensions
Added functioning logic for opening files
Removed debugging output
Added more filtering of files