Code cleanup of algorithm and utils, added iteration stop for low number of additions