Partially fixed issues with algorithm and counter
Partially fixed issues with algorithm and counter

Addressed #32 and #28

mostaphaRoudsari/SettlementEmerge,mostaphaRoudsari/SettlementEmerge,mostaphaRoudsari/SettlementEmerge