counter built-in deleted because of its time complexitiy