added counter routines