Almost working now, just need confidence intervals
Still need to add r, modify how A is incremented, and get confidence interval stuff working