edited to subtract bias from flat files before median combining.