I commented an unused variable "counter".