it now uses the proper file extension, and added shut down support.