Added -w option to output successful results to file.