added code for fitting the beta distribution from 10/30/14 meeting with Allen