Refactors slightly
Filters files correctly on test case
Refactors to take input from command line
Adds official solution