defensive pinning coding