implement sensors counter logic