Fixes #3 write results to a user-specified filename