fixed ngbr does't contain self problem

switched back to reference from ptr