Fix some bugs and add a simpler probability distribution.