working code of one digit counter 0-9