Some fixes to freq.simulate, and added some comments