lass="keyword">end</span>
                <span class="keyword">end</span>

                <span class="comment">% Inner loop over particles in the verlet list</span>
                <span class="keyword">for</span> j = 1:length(p1.verlet_p)
                    p2 = p1.verlet_p(j);

                    <span class="comment">% Check if particle has been deleted</span>
                    <span class="keyword">if</span> (~isvalid(p2))
                        p1.neigh_p(~isvalid(p1.neigh_p)) = [];
           