public static Map<Integer, Double> getResourcesFromUserWithRec(List<Bookmark> trainData, List<Bookmark> testData, int userID, Double dValue, boolean sorting) {
		Map<Integer, Double> resourceMap = new LinkedHashMap<Integer, Double>();
		long refTimestamp = Utilities.getBaselineTimestamp(testData, userID, false);
		for (Bookmark data : trainData) {		
			if (data.userID == userID) {
				if (dValue != null) {
					long timestamp = Long.parseLong(data.getTimestamp());
					Double rec = Math.pow(refTimestamp - timestamp + 1.0, dValue.doubleValue() * (-1.0));
					if (!rec.isInfinite() && !rec.isNaN()) {
						//resourceMap.put(data.resID, Math.log(rec.doubleValue() + 1.0));
						resourceMap.put(data.resID, rec.doubleValue());
					} else {
						//System.out.println("BLL - NAN");
						//resourceMap.put(data.resID, Math.log(1.0 + 1.0));
						resourceMap.put(data.resID, 1.0);
					}
				} else {
					resourceMap.put(data.resID, 1.0);
				}
			}
		}
		
		if (sorting) {
			// return the sorted resources
			Map<Integer, Double> sortedRankedResources = new TreeMap<Integer, Double>(new DoubleMapComparator(resourceMap));
			sortedRankedResources.putAll(resourceMap);
			return sortedRankedResources;
		} else {
			return resourceMap;
		}
	}