Not working still, need to fix two things.

* Add the code for specifying putput file name. and fix a probelm with the `else:`.