Some updates to dice algorithm