public ArrayList gettrace(int instructionindex)
    {
        
        ArrayList theprocessors=new ArrayList();
        if (!inuse) {return theprocessors;}
        int therange[]=getaddress(instructionindex);    // get the pc range of this instruction
        int maxsize=0;       
        for (int i=therange[0];i<therange[1];++i)   // find the maximum size of arraylist
        {            
            ArrayList currentone=trace[i];
            int thesize=currentone.size();
            if (thesize>maxsize){maxsize=thesize;}                
        }
        
        for (int j=0;j<maxsize;++j) // looks through until all lists searched
        {
            int prevp=0;
            for (int i=therange[0];i<therange[1];++i)   // while i is between the two pc values
            {
                if (trace[i].size() > j)    // if the size of the list is larger than j
                {
                    int thenum=((Integer) trace[i].get(j)).intValue();  // get the id of processor
                    if (thenum !=prevp) // equalled this in previous pass? if not then 
                    {
                        theprocessors.add(new Integer(thenum));
                        prevp=thenum;
                    }
                }
            }
        
        }
        return theprocessors;
    }