make counter a pointer