diff --git a/src/closestBed/closestBed.cpp b/src/closestBed/closestBed.cpp
index 046db2077c98ca89c0961accd25221032c0f7957..735e2a9ebfe3a8012592c58a30c61dc3827e3370 100644
--- a/src/closestBed/closestBed.cpp
+++ b/src/closestBed/closestBed.cpp
@@ -23,7 +23,7 @@ const int SLOPGROWTH = 2048000;
 */
 BedClosest::BedClosest(string &bedAFile, string &bedBFile, bool sameStrand, bool diffStrand,
                        string &tieMode, bool reportDistance, bool signDistance, string &_strandedDistMode,
-                       bool ignoreOverlaps) 
+                       bool ignoreOverlaps, bool printHeader) 
     : _bedAFile(bedAFile)
     , _bedBFile(bedBFile)
     , _tieMode(tieMode)
@@ -33,6 +33,7 @@ BedClosest::BedClosest(string &bedAFile, string &bedBFile, bool sameStrand, bool
     , _signDistance(signDistance)
     , _strandedDistMode(_strandedDistMode)
     , _ignoreOverlaps(ignoreOverlaps)
+    , _printHeader(printHeader)
 {
     _bedA           = new BedFile(_bedAFile);
     _bedB           = new BedFile(_bedBFile);
@@ -220,6 +221,10 @@ void BedClosest::FindClosestBed() {
     BedLineStatus bedStatus;
 
     _bedA->Open();
+    // report A's header first if asked.
+    if (_printHeader == true) {
+        _bedA->PrintHeader();
+    }
     // process each entry in A in search of the closest feature in B
     while ((bedStatus = _bedA->GetNextBed(a, lineNum)) != BED_INVALID) {
         if (bedStatus == BED_VALID) {
diff --git a/src/closestBed/closestBed.h b/src/closestBed/closestBed.h
index 82bd9b40b5fc6f6c2de1d246502f586f5ccdf923..8190dec93ee25443cb85c9a8a10a71547851d28a 100644
--- a/src/closestBed/closestBed.h
+++ b/src/closestBed/closestBed.h
@@ -30,7 +30,7 @@ public:
     BedClosest(string &bedAFile, string &bedBFile, 
                bool sameStrand, bool diffStrand, string &tieMode, 
                bool reportDistance, bool signDistance, string &strandedDistMode,
-               bool ignoreOverlaps);
+               bool ignoreOverlaps, bool printHeader);
 
     // destructor
     ~BedClosest(void);
@@ -50,6 +50,7 @@ private:
     bool   _signDistance;
     string _strandedDistMode;
     bool   _ignoreOverlaps;
+    bool   _printHeader;
 
     BedFile *_bedA, *_bedB;
 
diff --git a/src/closestBed/closestMain.cpp b/src/closestBed/closestMain.cpp
index 8b34a70743ef21688f3ed2067ca7da1c001d501c..0128af24fc6edbb4fa20558e56a1b541774be9b1 100644
--- a/src/closestBed/closestMain.cpp
+++ b/src/closestBed/closestMain.cpp
@@ -43,6 +43,7 @@ int main(int argc, char* argv[]) {
     bool reportDistance = false;
     bool signDistance   = false;
     bool haveStrandedDistMode = false;
+    bool printHeader        = false;
 
 
     // check to see if we should print out some help
@@ -106,6 +107,9 @@ int main(int argc, char* argv[]) {
                 i++;
             }
         }
+        else if(PARAMETER_CHECK("-header", 7, parameterLength)) {
+            printHeader = true;
+        }
         else {
             cerr << endl << "*****ERROR: Unrecognized parameter: " << argv[i] << " *****" << endl << endl;
             showHelp = true;
@@ -136,7 +140,9 @@ int main(int argc, char* argv[]) {
     }
     
     if (!showHelp) {
-        BedClosest *bc = new BedClosest(bedAFile, bedBFile, sameStrand, diffStrand, tieMode, reportDistance, signDistance, strandedDistMode, ignoreOverlaps);
+        BedClosest *bc = new BedClosest(bedAFile, bedBFile, sameStrand, 
+                                        diffStrand, tieMode, reportDistance, 
+                                        signDistance, strandedDistMode, ignoreOverlaps, printHeader);
         delete bc;
         return 0;
     }
@@ -191,6 +197,8 @@ void ShowHelp(void) {
     cerr                        << "\t\t- \"all\"    Report all ties (default)." << endl;
     cerr                        << "\t\t- \"first\"  Report the first tie that occurred in the B file." << endl;
     cerr                        << "\t\t- \"last\"   Report the last tie that occurred in the B file." << endl << endl;
+    
+    cerr << "\t-header\t"       << "Print the header from the A file prior to results." << endl << endl;
 
     cerr << "Notes: " << endl;
     cerr << "\tReports \"none\" for chrom and \"-1\" for all other fields when a feature" << endl;
diff --git a/src/flankBed/flankBed.cpp b/src/flankBed/flankBed.cpp
index 33ff711b5c8ad5377a518c746bd1f10e8d9604f2..f7e12495120281194aa38f5c22aa1695bb2e83a7 100644
--- a/src/flankBed/flankBed.cpp
+++ b/src/flankBed/flankBed.cpp
@@ -13,14 +13,18 @@
 #include "flankBed.h"
 
 
-BedFlank::BedFlank(string &bedFile, string &genomeFile, bool forceStrand, float leftFlank, float rightFlank, bool fractional) {
+BedFlank::BedFlank(string &bedFile, string &genomeFile, bool forceStrand, 
+                   float leftFlank, float rightFlank, bool fractional,
+                   bool printHeader) 
+{
 
     _bedFile      = bedFile;
     _genomeFile   = genomeFile;
     _forceStrand  = forceStrand;
     _leftFlank    = leftFlank;
     _rightFlank   = rightFlank;
-    _fractional   = fractional; 
+    _fractional   = fractional;
+    _printHeader  = printHeader;
 
     _bed    = new BedFile(bedFile);
     _genome = new GenomeFile(genomeFile);
@@ -42,6 +46,11 @@ void BedFlank::FlankBed() {
     BedLineStatus bedStatus;
 
     _bed->Open();
+    // report A's header first if asked.
+    if (_printHeader == true) {
+        _bed->PrintHeader();
+    }
+        
     bedStatus = _bed->GetNextBed(bedEntry, lineNum);
     while (bedStatus != BED_INVALID) {
         if (bedStatus == BED_VALID) {
diff --git a/src/flankBed/flankBed.h b/src/flankBed/flankBed.h
index a77326a80637d6602b007447d4b15dd6df068e41..f344f60f18686f84f796618a4ad1659a52430189 100644
--- a/src/flankBed/flankBed.h
+++ b/src/flankBed/flankBed.h
@@ -30,7 +30,9 @@ class BedFlank {
 public:
 
     // constructor
-    BedFlank(string &bedFile, string &genomeFile, bool forceStrand, float leftSlop, float rightSlop, bool fractional);
+    BedFlank(string &bedFile, string &genomeFile, bool forceStrand, 
+             float leftSlop, float rightSlop, bool fractional,
+             bool printHeader);
 
     // destructor
     ~BedFlank(void);
@@ -46,6 +48,7 @@ private:
     float  _leftFlank;
     float  _rightFlank;
     bool   _fractional;
+    bool   _printHeader;
 
     BedFile *_bed;
     GenomeFile *_genome;
diff --git a/src/flankBed/flankBedMain.cpp b/src/flankBed/flankBedMain.cpp
index 107db20e044e3d63b898a12a7805d7545338d51e..062839e6a377298ce849bd209ea5d9e093df46f5 100644
--- a/src/flankBed/flankBedMain.cpp
+++ b/src/flankBed/flankBedMain.cpp
@@ -43,6 +43,7 @@ int main(int argc, char* argv[]) {
     float leftSlop   = 0.0;
     float rightSlop  = 0.0;
     bool  fractional = false;
+    bool printHeader        = false;
 
     for(int i = 1; i < argc; i++) {
         int parameterLength = (int)strlen(argv[i]);
@@ -101,6 +102,9 @@ int main(int argc, char* argv[]) {
         else if(PARAMETER_CHECK("-pct", 4, parameterLength)) {
             fractional = true;
         }
+        else if(PARAMETER_CHECK("-header", 7, parameterLength)) {
+            printHeader = true;
+        }
         else {
           cerr << endl << "*****ERROR: Unrecognized parameter: " << argv[i] << " *****" << endl << endl;
             showHelp = true;
@@ -126,7 +130,8 @@ int main(int argc, char* argv[]) {
     }
 
     if (!showHelp) {
-        BedFlank *bc = new BedFlank(bedFile, genomeFile, forceStrand, leftSlop, rightSlop, fractional);
+        BedFlank *bc = new BedFlank(bedFile, genomeFile, forceStrand, 
+                                    leftSlop, rightSlop, fractional, printHeader);
         delete bc;
 
         return 0;
@@ -163,6 +168,8 @@ void ShowHelp(void) {
     cerr << "\t-pct\t"              << "Define -l and -r as a fraction of the feature's length." << endl;
     cerr                            << "\t\tE.g. if used on a 1000bp feature, -l 0.50, " << endl;
     cerr                            << "\t\twill add 500 bp \"upstream\".  Default = false." << endl << endl;
+    
+    cerr << "\t-header\t"           << "Print the header from the input file prior to results." << endl << endl;
 
     cerr << "Notes: " << endl;
     cerr << "\t(1)  Starts will be set to 0 if options would force it below 0." << endl;
diff --git a/src/intersectBed/intersectBed.cpp b/src/intersectBed/intersectBed.cpp
index de7bd74b08816ffc97dcf40c1263eab8989b0d4e..6a48b8802f118f9c5f36b3b5d0934ffcd3cc3da8 100644
--- a/src/intersectBed/intersectBed.cpp
+++ b/src/intersectBed/intersectBed.cpp
@@ -68,7 +68,7 @@ BedIntersect::BedIntersect(string bedAFile, string bedBFile, bool anyHit,
                            bool writeA, bool writeB, bool writeOverlap, bool writeAllOverlap,
                            float overlapFraction, bool noHit, bool writeCount, bool sameStrand, bool diffStrand,
                            bool reciprocal, bool obeySplits, bool bamInput, bool bamOutput, bool isUncompressedBam,
-                           bool sortedInput) {
+                           bool sortedInput, bool printHeader) {
 
     _bedAFile            = bedAFile;
     _bedBFile            = bedBFile;
@@ -88,6 +88,7 @@ BedIntersect::BedIntersect(string bedAFile, string bedBFile, bool anyHit,
     _bamOutput           = bamOutput;
     _isUncompressedBam   = isUncompressedBam;
     _sortedInput         = sortedInput;
+    _printHeader         = printHeader;
 
     // should we print each overlap, or does the user want summary information?
     _printable = true;
@@ -195,7 +196,6 @@ void BedIntersect::IntersectBed() {
         // compare each entry in A to it in search of overlaps.
         _bedB->loadBedFileIntoMap();
 
-        int lineNum = 0;
         vector<BED> hits;
         hits.reserve(100);
         BED a, nullBed;
@@ -203,7 +203,11 @@ void BedIntersect::IntersectBed() {
 
         // open the "A" file, process each BED entry and searh for overlaps.
         _bedA->Open();
-        while ((bedStatus = _bedA->GetNextBed(a, lineNum)) != BED_INVALID) {
+        // report A's header first if asked.
+        if (_printHeader == true) {
+            _bedA->PrintHeader();
+        }
+        while ((bedStatus = _bedA->GetNextBed(a)) != BED_INVALID) {
             if (bedStatus == BED_VALID) {
                 // treat the BED as a single "block"
                 if (_obeySplits == false) {
@@ -213,7 +217,7 @@ void BedIntersect::IntersectBed() {
                 // split the BED12 into blocks and look for overlaps in each discrete block
                 else {
                     bedVector bedBlocks;  // vec to store the discrete BED "blocks"
-                    splitBedIntoBlocks(a, lineNum, bedBlocks);
+                    splitBedIntoBlocks(a,bedBlocks);
 
                     vector<BED>::const_iterator bedItr  = bedBlocks.begin();
                     vector<BED>::const_iterator bedEnd  = bedBlocks.end();
diff --git a/src/intersectBed/intersectBed.h b/src/intersectBed/intersectBed.h
index a996b1553c1e261f157207048f7c6c76383b0829..b849446c5f7338e343e80b5c1767c0a62cec10af 100644
--- a/src/intersectBed/intersectBed.h
+++ b/src/intersectBed/intersectBed.h
@@ -38,7 +38,7 @@ public:
                                bool writeA, bool writeB, bool writeOverlap, bool writeAllOverlap,
                                float overlapFraction, bool noHit, bool writeCount, bool sameStrand, bool diffStrand,
                                bool reciprocal, bool obeySplits, bool bamInput, bool bamOutput, bool isUncompressedBam,
-                               bool sortedInput);
+                               bool sortedInput, bool printHeader);
 
     // destructor
     ~BedIntersect(void);
@@ -70,6 +70,7 @@ private:
     bool  _isUncompressedBam;
     bool  _sortedInput;
     bool  _printable;
+    bool  _printHeader;
     
     // instance of a bed file class.
     BedFile *_bedA, *_bedB;
diff --git a/src/intersectBed/intersectMain.cpp b/src/intersectBed/intersectMain.cpp
index 300154d1c5b2bf6a94ef46ae87009f6ee60dc183..3ae296decc153cfc0c05049f8bb20c737b85177a 100644
--- a/src/intersectBed/intersectMain.cpp
+++ b/src/intersectBed/intersectMain.cpp
@@ -54,6 +54,8 @@ int main(int argc, char* argv[]) {
     bool outputIsBam        = true;
     bool uncompressedBam    = false;
     bool sortedInput        = false;
+    bool printHeader        = false;
+
     // check to see if we should print out some help
     if(argc <= 1) showHelp = true;
 
@@ -145,7 +147,10 @@ int main(int argc, char* argv[]) {
         }
         else if(PARAMETER_CHECK("-sorted", 7, parameterLength)) {
             sortedInput = true;
-        }        
+        }
+        else if(PARAMETER_CHECK("-header", 7, parameterLength)) {
+            printHeader = true;
+        }
         else {
             cerr << endl << "*****ERROR: Unrecognized parameter: " << argv[i] << " *****" << endl << endl;
             showHelp = true;
@@ -212,7 +217,8 @@ int main(int argc, char* argv[]) {
 
         BedIntersect *bi = new BedIntersect(bedAFile, bedBFile, anyHit, writeA, writeB, writeOverlap,
                                             writeAllOverlap, overlapFraction, noHit, writeCount, sameStrand, diffStrand,
-                                            reciprocalFraction, obeySplits, inputIsBam, outputIsBam, uncompressedBam, sortedInput);
+                                            reciprocalFraction, obeySplits, inputIsBam, outputIsBam, uncompressedBam, 
+                                            sortedInput, printHeader);
         delete bi;
         return 0;
     }
@@ -285,9 +291,11 @@ void ShowHelp(void) {
 
     cerr << "\t-split\t"        << "Treat \"split\" BAM or BED12 entries as distinct BED intervals." << endl << endl;
 
-    cerr << "\t-sorted\t"        << "Use the \"chromsweep\" algorithm for sorted (-k1,1 -k2,2n) input" << endl;
+    cerr << "\t-sorted\t"       << "Use the \"chromsweep\" algorithm for sorted (-k1,1 -k2,2n) input" << endl;
     cerr                        << "\t\tNOTE: this will trust, but not enforce that data is sorted. Caveat emptor." << endl << endl;
-
+    
+    cerr << "\t-header\t"       << "Print the header from the A file prior to results." << endl << endl;
+ 
     // end the program here
     exit(1);
 
diff --git a/src/slopBed/slopBed.cpp b/src/slopBed/slopBed.cpp
index be9e37687c14f1e21cd626d24525dc43b65bf764..68eda5a2859aa7760aae8341d04f330865e45f87 100644
--- a/src/slopBed/slopBed.cpp
+++ b/src/slopBed/slopBed.cpp
@@ -13,14 +13,17 @@
 #include "slopBed.h"
 
 
-BedSlop::BedSlop(string &bedFile, string &genomeFile, bool forceStrand, float leftSlop, float rightSlop, bool fractional) {
+BedSlop::BedSlop(string &bedFile, string &genomeFile, bool forceStrand, 
+                 float leftSlop, float rightSlop, bool fractional,
+                 bool printHeader) {
 
     _bedFile     = bedFile;
     _genomeFile  = genomeFile;
     _forceStrand = forceStrand;
     _leftSlop    = leftSlop;
     _rightSlop   = rightSlop;
-    _fractional  = fractional; 
+    _fractional  = fractional;
+    _printHeader = printHeader;
 
     _bed    = new BedFile(bedFile);
     _genome = new GenomeFile(genomeFile);
@@ -42,6 +45,11 @@ void BedSlop::SlopBed() {
     BedLineStatus bedStatus;
 
     _bed->Open();
+    // report header first if asked.
+    if (_printHeader == true) {
+        _bed->PrintHeader();
+    }
+        
     bedStatus = _bed->GetNextBed(bedEntry, lineNum);
     while (bedStatus != BED_INVALID) {
         if (bedStatus == BED_VALID) {
diff --git a/src/slopBed/slopBed.h b/src/slopBed/slopBed.h
index d22590c729a8da7c6241b07636dac784d3ed6e23..7de0afd728cce49b85f31f0ec60c1f2efbcd4001 100644
--- a/src/slopBed/slopBed.h
+++ b/src/slopBed/slopBed.h
@@ -30,7 +30,8 @@ class BedSlop {
 public:
 
     // constructor
-    BedSlop(string &bedFile, string &genomeFile, bool forceStrand, float leftSlop, float rightSlop, bool fractional);
+    BedSlop(string &bedFile, string &genomeFile, bool forceStrand, 
+            float leftSlop, float rightSlop, bool fractional, bool printHeader);
 
     // destructor
     ~BedSlop(void);
@@ -46,6 +47,7 @@ private:
     float  _leftSlop;
     float  _rightSlop;
     bool   _fractional;
+    bool   _printHeader;
 
     BedFile *_bed;
     GenomeFile *_genome;
diff --git a/src/slopBed/slopBedMain.cpp b/src/slopBed/slopBedMain.cpp
index 01e0164908b49cb981498ca9753e156b5f51697f..b5f148e56dc6aab8aa714a1f7cc45ba8f01ded44 100644
--- a/src/slopBed/slopBedMain.cpp
+++ b/src/slopBed/slopBedMain.cpp
@@ -43,6 +43,7 @@ int main(int argc, char* argv[]) {
     float leftSlop   = 0.0;
     float rightSlop  = 0.0;
     bool  fractional = false;
+    bool printHeader = false;
 
     for(int i = 1; i < argc; i++) {
         int parameterLength = (int)strlen(argv[i]);
@@ -101,6 +102,9 @@ int main(int argc, char* argv[]) {
         else if(PARAMETER_CHECK("-pct", 4, parameterLength)) {
             fractional = true;
         }
+        else if(PARAMETER_CHECK("-header", 7, parameterLength)) {
+            printHeader = true;
+        }
         else {
           cerr << endl << "*****ERROR: Unrecognized parameter: " << argv[i] << " *****" << endl << endl;
             showHelp = true;
@@ -126,7 +130,7 @@ int main(int argc, char* argv[]) {
     }
 
     if (!showHelp) {
-        BedSlop *bc = new BedSlop(bedFile, genomeFile, forceStrand, leftSlop, rightSlop, fractional);
+        BedSlop *bc = new BedSlop(bedFile, genomeFile, forceStrand, leftSlop, rightSlop, fractional, printHeader);
         delete bc;
 
         return 0;
@@ -164,6 +168,8 @@ void ShowHelp(void) {
     cerr                            << "\t\tE.g. if used on a 1000bp feature, -l 0.50, " << endl;
     cerr                            << "\t\twill add 500 bp \"upstream\".  Default = false." << endl << endl;
 
+    cerr << "\t-header\t"           << "Print the header from the input file prior to results." << endl << endl;
+
     cerr << "Notes: " << endl;
     cerr << "\t(1)  Starts will be set to 0 if options would force it below 0." << endl;
     cerr << "\t(2)  Ends will be set to the chromosome length if  requested slop would" << endl;
diff --git a/src/utils/bedFile/bedFile.cpp b/src/utils/bedFile/bedFile.cpp
index ec303579095b8f86bc71a709f79570a679683900..3e9e38240f16fc8d41034691d88c95fb45da598b 100644
--- a/src/utils/bedFile/bedFile.cpp
+++ b/src/utils/bedFile/bedFile.cpp
@@ -15,16 +15,16 @@
 /************************************************
 Helper functions
 *************************************************/
-void splitBedIntoBlocks(const BED &bed, int lineNum, bedVector &bedBlocks) {
+void splitBedIntoBlocks(const BED &bed, bedVector &bedBlocks) {
 
     if (bed.otherFields.size() < 6) {
-        cerr << "Input error: Cannot split into blocks. Found interval with fewer than 12 columns on line " << lineNum << "." << endl;
+        cerr << "Input error: Cannot split into blocks. Found interval with fewer than 12 columns." << endl;
         exit(1);
     }
 
     int blockCount = atoi(bed.otherFields[3].c_str());
     if ( blockCount <= 0 ) {
-        cerr << "Input error: found interval having <= 0 blocks on line " << lineNum << "." << endl;
+        cerr << "Input error: found interval having <= 0 blocks." << endl;
         exit(1);
     }
     else if ( blockCount == 1 ) {
@@ -42,7 +42,7 @@ void splitBedIntoBlocks(const BED &bed, int lineNum, bedVector &bedBlocks) {
         Tokenize(blockStarts, starts, ",");
 
         if ( sizes.size() != (size_t) blockCount || starts.size() != (size_t) blockCount ) {
-            cerr << "Input error: found interval with block-counts not matching starts/sizes on line " << lineNum << "." << endl;
+            cerr << "Input error: found interval with block-counts not matching starts/sizes on line." << endl;
             exit(1);
         }
 
@@ -151,6 +151,8 @@ void BedFile::Open(void) {
             exit (1);
         }
     }
+    // save the file's header (if there is one)
+    GetHeader();
 }
 
 // Rewind the pointer back to the beginning of the file
@@ -164,7 +166,7 @@ void BedFile::Seek(unsigned long offset) {
 }
 
 // Jump to a specific byte in the file
-bool BedFile::Empty() {
+bool BedFile::Empty(void) {
     return _bedStream->eof();
 }
 
@@ -173,23 +175,57 @@ void BedFile::Close(void) {
     if (bedFile != "stdin" && bedFile != "-") delete _bedStream;
 }
 
+void BedFile::GetLine(void) {
+    // parse the bedStream pointer
+    getline(*_bedStream, _bedLine);
+    // increment the line number
+    _lineNum++;
+    // split into a string vector.
+    Tokenize(_bedLine, _bedFields);
+}
 
-BedLineStatus BedFile::GetNextBed(BED &bed, int &lineNum, bool forceSorted) {
+// Extract and store the header for the file.
+void BedFile::GetHeader(void) {
+    while(getline(*_bedStream, _bedLine))
+    {
+        if ( (_bedLine.find("#") != string::npos) ||
+             (_bedLine.find("browser") != string::npos) ||
+             (_bedLine.find("track") != string::npos) )
+        {
+            _header += _bedLine + '\n';
+        }
+        else
+        {
+            _firstLine = true;
+            break;
+        }
+    }
+}
+
+// Dump the header
+void BedFile::PrintHeader(void) {
+    cout << _header;
+}
+
+
+BedLineStatus BedFile::GetNextBed(BED &bed, bool forceSorted) {
 
     // make sure there are still lines to process.
     // if so, tokenize, validate and return the BED entry.
     _bedFields.clear();
     // clear out the previous bed's data
     if (_bedStream->good()) {
-        // parse the bedStream pointer
-        getline(*_bedStream, _bedLine);
-        lineNum++;
-
-        // split into a string vector.
-        Tokenize(_bedLine, _bedFields);
-
+        // read the next line in the file and parse into discrete fields
+        if (!_firstLine)
+            GetLine();
+        else {
+            // handle the first line as a special case because
+            // of reading the header.
+            Tokenize(_bedLine, _bedFields);
+            _firstLine = false;
+        }
         // load the BED struct as long as it's a valid BED entry.
-        BedLineStatus status = parseLine(bed, _bedFields, lineNum);
+        BedLineStatus status = parseLine(bed, _bedFields);
         if (!forceSorted) {
             return status;
         }
@@ -220,13 +256,13 @@ BedLineStatus BedFile::GetNextBed(BED &bed, int &lineNum, bool forceSorted) {
 }
 
 
-bool BedFile::GetNextMergedBed(BED &merged_bed, int &lineNum) {
+bool BedFile::GetNextMergedBed(BED &merged_bed) {
 
     if (_bedStream->good()) {
         BED bed;
         BedLineStatus bedStatus;
         // force sorting; hence third param = true
-        while ((bedStatus = GetNextBed(bed, lineNum, true)) != BED_INVALID) {
+        while ((bedStatus = GetNextBed(bed, true)) != BED_INVALID) {
             if (bedStatus == BED_VALID) {
                 if (((int) bed.start - _merged_end > 0) || 
                    (_merged_end < 0) || 
diff --git a/src/utils/bedFile/bedFile.h b/src/utils/bedFile/bedFile.h
index e8c56b4e2642bc9d00b72410356cb0cb8f653c62..9cd78e4a93d75e109288e5e52d04c91ff85a480c 100644
--- a/src/utils/bedFile/bedFile.h
+++ b/src/utils/bedFile/bedFile.h
@@ -377,7 +377,7 @@ bool after(const BED &a, const BED &b) {
 
 
 // Ancillary functions
-void splitBedIntoBlocks(const BED &bed, int lineNum, bedVector &bedBlocks);
+void splitBedIntoBlocks(const BED &bed, bedVector &bedBlocks);
 
 
 // BED Sorting Methods
@@ -404,27 +404,34 @@ public:
     // Destructor
     ~BedFile(void);
 
+    /********* File management ********/
     // Open a BED file for reading (creates an istream pointer)
     void Open(void);
 
+    // Close an opened BED file.
+    void Close(void);
+
+    // are the any intervals left in the file?
+    bool Empty(void);
+
     // Rewind the pointer back to the beginning of the file
     void Rewind(void);
 
     // Jump to a specific byte in the file
     void Seek(unsigned long offset);
-   
 
-    bool Empty();
+    // dump the header, which is collected as part of Open()
+    void PrintHeader(void);
 
-    // Close an opened BED file.
-    void Close(void);
+    // get the next line in the file. splits a line in _bedFields
+    void GetLine(void);
 
     // Get the next BED entry in an opened BED file.
-    BedLineStatus GetNextBed (BED &bed, int &lineNum, bool forceSorted = false);
+    BedLineStatus GetNextBed (BED &bed, bool forceSorted = false);
     
     // Returns the next MERGED (i.e., non-overlapping) interval in an opened BED file
     // NOTE: assumes input file is sorted by chrom then start
-    bool GetNextMergedBed(BED &merged_bed, int &lineNum);
+    bool GetNextMergedBed(BED &merged_bed);
 
     // load a BED file into a map keyed by chrom, then bin. value is vector of BEDs
     void loadBedFileIntoMap();
@@ -490,6 +497,9 @@ private:
     FileType   _fileType;     // what is the file type? (BED? GFF? VCF?)
     istream   *_bedStream;
     string _bedLine;
+    int _lineNum;
+    string _header;
+    bool _firstLine;
     vector<string> _bedFields;
     int _merged_start;
     int _merged_end;
@@ -503,6 +513,9 @@ private:
     void setFileType (FileType type);
     void setBedType (int colNums);
 
+    /************ Private utilities ***********************/
+    void GetHeader(void);
+
     /******************************************************
     Private definitions to circumvent linker issues with
     templated member functions.
@@ -512,10 +525,8 @@ private:
         parseLine: converts a lineVector into either BED or BEDCOV (templated, hence in header to avoid linker issues.)
     */
     template <typename T>
-    inline BedLineStatus parseLine (T &bed, const vector<string> &lineVector, int &lineNum) {
+    inline BedLineStatus parseLine (T &bed, const vector<string> &lineVector) {
 
-        //char *p2End, *p3End, *p4End, *p5End;
-        //long l2, l3, l4, l5;
         unsigned int numFields = lineVector.size();
 
         // bail out if we have a blank line
@@ -523,65 +534,59 @@ private:
             return BED_BLANK;
         }
 
-        if ((lineVector[0].find("track") == string::npos) && (lineVector[0].find("browser") == string::npos) && (lineVector[0].find("#") == string::npos) ) {
-
-            if (numFields >= 3) {
-                // line parsing for all lines after the first non-header line
-                if (_typeIsKnown == true) {
-                    switch(_fileType) {
-                        case BED_FILETYPE:
-                            if (parseBedLine(bed, lineVector, lineNum, numFields) == true) return BED_VALID;
-                        case VCF_FILETYPE:
-                            if (parseVcfLine(bed, lineVector, lineNum, numFields) == true) return BED_VALID;
-                        case GFF_FILETYPE:
-                            if (parseGffLine(bed, lineVector, lineNum, numFields) == true) return BED_VALID;
-                        default:
-                            printf("ERROR: file type encountered. Exiting\n");
-                            exit(1);
-                    }
-                }
-                // line parsing for first non-header line: figure out file contents
-                else {
-                    // it's BED format if columns 2 and 3 are integers
-                    if (isInteger(lineVector[1]) && isInteger(lineVector[2])) {
-                        setGff(false);
-                        setZeroBased(true);
-                        setFileType(BED_FILETYPE);
-                        setBedType(numFields);       // we now expect numFields columns in each line
-                        if (parseBedLine(bed, lineVector, lineNum, numFields) == true) return BED_VALID;
-                    }
-                    // it's VCF, assuming the second column is numeric and there are at least 8 fields.
-                    else if (isInteger(lineVector[1]) && numFields >= 8) {
-                        setGff(false);
-                        setVcf(true);
-                        setZeroBased(false);
-                        setFileType(VCF_FILETYPE);
-                        setBedType(numFields);       // we now expect numFields columns in each line
-                        if (parseVcfLine(bed, lineVector, lineNum, numFields) == true) return BED_VALID;
-                    }
-                    // it's GFF, assuming columns columns 4 and 5 are numeric and we have 9 fields total.
-                    else if ((numFields >= 8) && isInteger(lineVector[3]) && isInteger(lineVector[4])) {
-                        setGff(true);
-                        setZeroBased(false);
-                        setFileType(GFF_FILETYPE);
-                        setBedType(numFields);       // we now expect numFields columns in each line
-                        if (parseGffLine(bed, lineVector, lineNum, numFields) == true) return BED_VALID;
-                    }
-                    else {
-                        cerr << "Unexpected file format.  Please use tab-delimited BED, GFF, or VCF. " <<
-                                "Perhaps you have non-integer starts or ends at line " << lineNum << "?" << endl;
+
+        if (numFields >= 3) {
+            // line parsing for all lines after the first non-header line
+            if (_typeIsKnown == true) {
+                switch(_fileType) {
+                    case BED_FILETYPE:
+                        if (parseBedLine(bed, lineVector, _lineNum, numFields) == true) return BED_VALID;
+                    case VCF_FILETYPE:
+                        if (parseVcfLine(bed, lineVector, _lineNum, numFields) == true) return BED_VALID;
+                    case GFF_FILETYPE:
+                        if (parseGffLine(bed, lineVector, _lineNum, numFields) == true) return BED_VALID;
+                    default:
+                        printf("ERROR: file type encountered. Exiting\n");
                         exit(1);
-                    }
                 }
             }
+            // line parsing for first non-header line: figure out file contents
             else {
-                cerr << "It looks as though you have less than 3 columns at line: " << lineNum << ".  Are you sure your files are tab-delimited?" << endl;
-                exit(1);
+                // it's BED format if columns 2 and 3 are integers
+                if (isInteger(lineVector[1]) && isInteger(lineVector[2])) {
+                    setGff(false);
+                    setZeroBased(true);
+                    setFileType(BED_FILETYPE);
+                    setBedType(numFields);       // we now expect numFields columns in each line
+                    if (parseBedLine(bed, lineVector, _lineNum, numFields) == true) return BED_VALID;
+                }
+                // it's VCF, assuming the second column is numeric and there are at least 8 fields.
+                else if (isInteger(lineVector[1]) && numFields >= 8) {
+                    setGff(false);
+                    setVcf(true);
+                    setZeroBased(false);
+                    setFileType(VCF_FILETYPE);
+                    setBedType(numFields);       // we now expect numFields columns in each line
+                    if (parseVcfLine(bed, lineVector, _lineNum, numFields) == true) return BED_VALID;
+                }
+                // it's GFF, assuming columns columns 4 and 5 are numeric and we have 9 fields total.
+                else if ((numFields >= 8) && isInteger(lineVector[3]) && isInteger(lineVector[4])) {
+                    setGff(true);
+                    setZeroBased(false);
+                    setFileType(GFF_FILETYPE);
+                    setBedType(numFields);       // we now expect numFields columns in each line
+                    if (parseGffLine(bed, lineVector, _lineNum, numFields) == true) return BED_VALID;
+                }
+                else {
+                    cerr << "Unexpected file format.  Please use tab-delimited BED, GFF, or VCF. " <<
+                            "Perhaps you have non-integer starts or ends at line " << _lineNum << "?" << endl;
+                    exit(1);
+                }
             }
         }
         else {
-            lineNum--;
-            return BED_HEADER;
+            cerr << "It looks as though you have less than 3 columns at line: " << _lineNum << ".  Are you sure your files are tab-delimited?" << endl;
+            exit(1);
         }
         // default
         return BED_INVALID;
@@ -592,7 +597,7 @@ private:
         parseBedLine: converts a lineVector into either BED or BEDCOV (templated, hence in header to avoid linker issues.)
     */
     template <typename T>
-    inline bool parseBedLine (T &bed, const vector<string> &lineVector, int lineNum, unsigned int numFields) {
+    inline bool parseBedLine (T &bed, const vector<string> &lineVector, int _lineNum, unsigned int numFields) {
 
         // process as long as the number of fields in this
         // line matches what we expect for this file.
@@ -601,13 +606,13 @@ private:
             int i;
             i = atoi(lineVector[1].c_str());
             if (i<0) {
-                 cerr << "Error: malformed BED entry at line " << lineNum << ". Start Coordinate detected that is < 0. Exiting." << endl;
+                 cerr << "Error: malformed BED entry at line " << _lineNum << ". Start Coordinate detected that is < 0. Exiting." << endl;
                  exit(1);
             }
             bed.start = (CHRPOS)i;
             i = atoi(lineVector[2].c_str());
             if (i<0) {
-                cerr << "Error: malformed BED entry at line " << lineNum << ". End Coordinate detected that is < 0. Exiting." << endl;
+                cerr << "Error: malformed BED entry at line " << _lineNum << ". End Coordinate detected that is < 0. Exiting." << endl;
                 exit(1);
             }
             bed.end = (CHRPOS)i;
@@ -640,7 +645,7 @@ private:
                 }
             }
             else if (this->bedType != 3) {
-                cerr << "Error: unexpected number of fields at line: " << lineNum
+                cerr << "Error: unexpected number of fields at line: " << _lineNum
                      << ".  Verify that your files are TAB-delimited.  Exiting..." << endl;
                 exit(1);
             }
@@ -650,20 +655,20 @@ private:
                 return true;
             }
             else {
-                cerr << "Error: malformed BED entry at line " << lineNum << ". Start was greater than end. Exiting." << endl;
+                cerr << "Error: malformed BED entry at line " << _lineNum << ". Start was greater than end. Exiting." << endl;
                 exit(1);
             }
         }
         else if (numFields == 1) {
-            cerr << "Only one BED field detected: " << lineNum << ".  Verify that your files are TAB-delimited.  Exiting..." << endl;
+            cerr << "Only one BED field detected: " << _lineNum << ".  Verify that your files are TAB-delimited.  Exiting..." << endl;
             exit(1);
         }
         else if ((numFields != this->bedType) && (numFields != 0)) {
-            cerr << "Differing number of BED fields encountered at line: " << lineNum << ".  Exiting..." << endl;
+            cerr << "Differing number of BED fields encountered at line: " << _lineNum << ".  Exiting..." << endl;
             exit(1);
         }
         else if ((numFields < 3) && (numFields != 0)) {
-            cerr << "TAB delimited BED file with at least 3 fields (chrom, start, end) is required at line: "<< lineNum << ".  Exiting..." << endl;
+            cerr << "TAB delimited BED file with at least 3 fields (chrom, start, end) is required at line: "<< _lineNum << ".  Exiting..." << endl;
             exit(1);
         }
         return false;
@@ -674,7 +679,7 @@ private:
         parseVcfLine: converts a lineVector into either BED or BEDCOV (templated, hence in header to avoid linker issues.)
     */
     template <typename T>
-    inline bool parseVcfLine (T &bed, const vector<string> &lineVector, int lineNum, unsigned int numFields) {
+    inline bool parseVcfLine (T &bed, const vector<string> &lineVector, int _lineNum, unsigned int numFields) {
         if (numFields == this->bedType) {
             bed.chrom  = lineVector[0];
             bed.start  = atoi(lineVector[1].c_str()) - 1;  // VCF is one-based
@@ -696,24 +701,24 @@ private:
                 return true;
             }
             else if (bed.start > bed.end) {
-                cerr << "Error: malformed VCF entry at line " << lineNum << ". Start was greater than end. Exiting." << endl;
+                cerr << "Error: malformed VCF entry at line " << _lineNum << ". Start was greater than end. Exiting." << endl;
                 exit(1);
             }
             else if ( (bed.start < 0) || (bed.end < 0) ) {
-                cerr << "Error: malformed VCF entry at line " << lineNum << ". Coordinate detected that is < 0. Exiting." << endl;
+                cerr << "Error: malformed VCF entry at line " << _lineNum << ". Coordinate detected that is < 0. Exiting." << endl;
                 exit(1);
             }
         }
         else if (numFields == 1) {
-            cerr << "Only one VCF field detected: " << lineNum << ".  Verify that your files are TAB-delimited.  Exiting..." << endl;
+            cerr << "Only one VCF field detected: " << _lineNum << ".  Verify that your files are TAB-delimited.  Exiting..." << endl;
             exit(1);
         }
         else if ((numFields != this->bedType) && (numFields != 0)) {
-            cerr << "Differing number of VCF fields encountered at line: " << lineNum << ".  Exiting..." << endl;
+            cerr << "Differing number of VCF fields encountered at line: " << _lineNum << ".  Exiting..." << endl;
             exit(1);
         }
         else if ((numFields < 2) && (numFields != 0)) {
-            cerr << "TAB delimited VCF file with at least 2 fields (chrom, pos) is required at line: "<< lineNum << ".  Exiting..." << endl;
+            cerr << "TAB delimited VCF file with at least 2 fields (chrom, pos) is required at line: "<< _lineNum << ".  Exiting..." << endl;
             exit(1);
         }
         return false;
diff --git a/src/windowBed/windowBed.cpp b/src/windowBed/windowBed.cpp
index 513d91fef05c5cbc0a59d00f05d611d1b6a9bd88..b93ea4ae8fef38753f00afff61b6cb6acf03a008 100644
--- a/src/windowBed/windowBed.cpp
+++ b/src/windowBed/windowBed.cpp
@@ -18,7 +18,8 @@
 */
 BedWindow::BedWindow(string bedAFile, string bedBFile, int leftSlop, int rightSlop,
                      bool anyHit, bool noHit, bool writeCount, bool strandWindows,
-                     bool matchOnSameStrand, bool matchOnDiffStrand, bool bamInput, bool bamOutput, bool isUncompressedBam) {
+                     bool matchOnSameStrand, bool matchOnDiffStrand, bool bamInput, 
+                     bool bamOutput, bool isUncompressedBam, bool printHeader) {
 
     _bedAFile      = bedAFile;
     _bedBFile      = bedBFile;
@@ -35,6 +36,7 @@ BedWindow::BedWindow(string bedAFile, string bedBFile, int leftSlop, int rightSl
     _bamInput            = bamInput;
     _bamOutput           = bamOutput;
     _isUncompressedBam   = isUncompressedBam;
+    _printHeader         = printHeader;
 
     _bedA          = new BedFile(bedAFile);
     _bedB          = new BedFile(bedBFile);
@@ -133,6 +135,10 @@ void BedWindow::WindowIntersectBed() {
     hits.reserve(100);
 
     _bedA->Open();
+    // report A's header first if asked.
+    if (_printHeader == true) {
+        _bedA->PrintHeader();
+    }
     while ((bedStatus = _bedA->GetNextBed(a, lineNum)) != BED_INVALID) {
         if (bedStatus == BED_VALID) {
             FindWindowOverlaps(a, hits);
diff --git a/src/windowBed/windowBed.h b/src/windowBed/windowBed.h
index 84f1b1b1e9e4fa576be0cd35198699f56d499481..31c8a076c43c14c8ada993df96d94e1c9741226e 100644
--- a/src/windowBed/windowBed.h
+++ b/src/windowBed/windowBed.h
@@ -34,7 +34,8 @@ public:
     // constructor
     BedWindow(string bedAFile, string bedBFile, int leftSlop, int rightSlop,
               bool anyHit, bool noHit, bool writeCount, bool strandWindows,
-              bool matchOnSameStrand, bool matchOnDiffStrand, bool bamInput, bool bamOutput, bool isUncompressedBam);
+              bool matchOnSameStrand, bool matchOnDiffStrand, bool bamInput,
+              bool bamOutput, bool isUncompressedBam, bool printHeader);
 
     // destructor
     ~BedWindow(void);
@@ -53,7 +54,8 @@ private:
     bool _matchOnDiffStrand;
     bool _bamInput;
     bool _bamOutput;
-    bool  _isUncompressedBam;
+    bool _isUncompressedBam;
+    bool _printHeader;
 
     // instance of a bed file class.
     BedFile *_bedA, *_bedB;
diff --git a/src/windowBed/windowMain.cpp b/src/windowBed/windowMain.cpp
index 7d70f3a4359951b233cf83b31e8f1812390f8a1f..cbb5739a14120596893da0d89c26e34a78809249 100644
--- a/src/windowBed/windowMain.cpp
+++ b/src/windowBed/windowMain.cpp
@@ -37,20 +37,21 @@ int main(int argc, char* argv[]) {
     int leftSlop  = 1000;
     int rightSlop = 1000;
 
-    bool haveBedA        = false;
-    bool haveBedB        = false;
-    bool noHit           = false;
-    bool anyHit          = false;
-    bool writeCount      = false;
-    bool haveSlop        = false;
-    bool haveLeft        = false;
-    bool haveRight       = false;
-    bool strandWindows   = false;
+    bool haveBedA            = false;
+    bool haveBedB            = false;
+    bool noHit               = false;
+    bool anyHit              = false;
+    bool writeCount          = false;
+    bool haveSlop            = false;
+    bool haveLeft            = false;
+    bool haveRight           = false;
+    bool strandWindows       = false;
     bool matchOnSameStrand   = false;
     bool matchOnDiffStrand   = false;
-    bool inputIsBam      = false;
-    bool outputIsBam     = true;
-    bool uncompressedBam = false;
+    bool inputIsBam          = false;
+    bool outputIsBam         = true;
+    bool uncompressedBam     = false;
+    bool printHeader         = false;
 
     // check to see if we should print out some help
     if(argc <= 1) showHelp = true;
@@ -139,6 +140,9 @@ int main(int argc, char* argv[]) {
         else if(PARAMETER_CHECK("-ubam", 5, parameterLength)) {
             uncompressedBam = true;
         }
+        else if(PARAMETER_CHECK("-header", 7, parameterLength)) {
+            printHeader = true;
+        }
         else {
             cerr << endl << "*****ERROR: Unrecognized parameter: " << argv[i] << " *****" << endl << endl;
             showHelp = true;
@@ -189,7 +193,7 @@ int main(int argc, char* argv[]) {
     if (!showHelp) {
         BedWindow *bi = new BedWindow(bedAFile, bedBFile, leftSlop, rightSlop, anyHit,
                                       noHit, writeCount, strandWindows, matchOnSameStrand, matchOnDiffStrand,
-                                      inputIsBam, outputIsBam, uncompressedBam);
+                                      inputIsBam, outputIsBam, uncompressedBam, printHeader);
         delete bi;
         return 0;
     }
@@ -257,6 +261,8 @@ void ShowHelp(void) {
 
     cerr << "\t-v\t"            << "Only report those entries in A that have _no overlaps_ with B." << endl;
     cerr                        << "\t\t- Similar to \"grep -v.\"" << endl << endl;
+    
+    cerr << "\t-header\t"       << "Print the header from the A file prior to results." << endl << endl;
 
     // end the program here
     exit(1);