Adding counring algo