added FITS writing