Added a more general Distribution class.