Add enable signal
Move reset of current_iteration to the start of an update
Slight refactoring to fix code style issues