pinning and counting