fix conflict 1
fix conflict 2
fix conflict 3
Revert "Update parameters + minor changes"

This reverts commit 302f263eef66118e1f39d22bc9c5befa3d3abd60.
Revert "Revert "Update parameters + minor changes""

This reverts commit 99dc983b84eea2cccaae86aa552b435e05c9b891.
fix conflict 4
fix conflict 5
fix conflict 6
fix conflict 7
fix conflict 8
Don't use maxrev when nmen is 1.
fix conflict 9
Fix some bugs
fix conflict 10
fix conflict 11
FC 1
fix conflict 12
FC 4
FC 5
fix conflict 13