added a previous counter to avoid repetitions