cleaned up the FITS IO a bit