public List<SearchEntry> getUniqueProducts(Double tot, Integer num) {
        Double remaining = tot;
        List<SearchEntry> products = new ArrayList<SearchEntry>();
        products.addAll(this.entries);

        List<SearchEntry> toreturn = new ArrayList<SearchEntry>();
        SearchEntry init = this.getItemByPrice(tot / num);
        int pivot = -1;
        for (int i = 0; i < products.size(); i++) {
            if (products.get(i) == init) {
                pivot = i;
                remaining -= products.get(i).getPriceAfterDiscount();
                toreturn.add(products.get(i));
                products.remove(i);
                break;
            }
        }
        while (toreturn.size() < num) {
            //no more unique products
            if (products.isEmpty()) {
                SearchEntry s = getItemByPrice(remaining / (num - toreturn.size()));
                for (int i = 0; i != num - toreturn.size(); i++) {
                    toreturn.add(s);
                }
            }
            double target_price = remaining / (num - toreturn.size());
            SearchEntry se = this.getItemByPrice(target_price, products);
            remaining -= se.getPriceAfterDiscount();
            toreturn.add(se);
            products.remove(se);
        }
        return toreturn;
    }