case insensitive handling of variable names.
handle gzipped input files
more bounds checking.
(what to do with out-of-range median values? Ignore or fix at min/max?)
typos