Updated with Babbitts scripts and WC function in R