rewrote fdr calculation and argument parsing