Adopting the simple implementation of probability distributions from sf.distlib
added license headers