bug found: counter not incrementing??
counter increments when not in separate function...