working model of counter and depth