public synchronized void removeClient(SimClient client) {
        bodyArray = null;
        if (clients == null) {
            return;
        }

        int i;
        for (i = 0; i < clients.length; i++) {
            if (clients[i] == client) {
                break;
            }
        }

        if (i == clients.length) {
            // the client wasn't on list anyway, I don't expect this to happen
            return;
        }

        if (clients.length == 1) {
            // there are no more clients.  Any motionTask
            // in the queue is no longer needed.
            clients = null;
            scheduler.remove(motionTask);
        } else {
            SimClient[] c = new SimClient[clients.length - 1];
            int n = 0;
            for (i = 0; i < clients.length; i++) {
                if (clients[i] == client) {
                    continue;
                }
                c[n++] = clients[i];
            }
            clients = c;
        }
        queueAnimationEvent();

        int maxInterlockSent;
        maxInterlockSent = client.getMaxInterlockSent();
        if (maxInterlockSent > 0) {
            closeInterlock(maxInterlockSent);
        }
    }