Counter implementation is partially done

fixed bugs in Ringmap