public List<Integer> segmentSoe(int start, int end) {
        //Initialize array.
        List<Element> allNumbers = new LinkedList<Element>();
        //Populate with all numbers from start to end.
        for (int i=start; i<=end; i++)
            allNumbers.add(new Element(i, false));

        int N = (int) Math.sqrt(end);
        List<Integer> initialPrimes = soe(N);



        for (int i=0; i<initialPrimes.size(); i++) {
            int p = initialPrimes.get(i);
            int x = (int) Math.floor(start/p);
            x = x*p;
            if (x<start)
                x=x+p;


            while (x <= end) {

                for (int z=0; z<allNumbers.size(); z++) {
                    if (allNumbers.get(z).getEle() == x) {
                        Element ele = allNumbers.get(z);
                        ele.setMarked(true);
                        allNumbers.set(z, ele);
                        x=x+p;
                    }
                }
            }
        }

        List<Integer> retList = new LinkedList<Integer>();
        for (int s=0; s<allNumbers.size(); s++) {
            if (!allNumbers.get(s).isMarked())
                retList.add(allNumbers.get(s).getEle());
        }

        return retList;
    }