fixed bug with reordering distributions for simplified mode; small style fixes