fix bug in ramp rate calculation; cleanup; remove verbose stuff; add some comments;