add option settling time
some code cleanup