added working digital counter