Adding logistic model fitting and other math and plotting functions