private Map<Integer, Double> getRankedResourcesList(
			int userID,  
			List<Map<Integer, Double>> userResourcesWeights, 
			boolean sorting) {
		Map<Integer, Double> candidateResources = new LinkedHashMap<Integer, Double>();
		
		// get candidates
		int i = 0;
		Map<Integer, Double> sortedNeighbors = 
				Utilities.getNeighbors(userID, -1, allUsersSimilarities, userResourcesWeights, trainList, similarity);
		
		Double userSimiliaritySum = 0.0;
		
		for (Map.Entry<Integer, Double> neighbor : sortedNeighbors.entrySet()) {
			if (i++ > MAX_NEIGHBORS) {
				break;
			}
//			System.out.println("Neighbour: " + neighbor);
			double userSimVal = neighbor.getValue();
			userSimiliaritySum += userSimVal;
			
			if (userSimVal != 0.0) {
				List<Integer> resources = Bookmark.getResourcesFromUser(trainList, neighbor.getKey());
				
				for (Integer resID : resources) {
					if (! userResourcesTagWeight.get(userID).containsKey(resID)) {
						Double resourceScore = candidateResources.get(resID);
						
						Double resourceWeight = userResourcesWeights.get(neighbor.getKey()).get(resID) * userSimVal;
//								scoreCalculator.getScore(neighbor.getKey(), resID) * userSimVal;
						
						resourceScore = (resourceScore != null) ? (resourceScore + resourceWeight) : resourceWeight;

						candidateResources.put(resID, resourceScore);
					}
				}
			}
		}
		
		for (Integer resource : candidateResources.keySet()) {
			double resourceScore = candidateResources.get(resource) / Math.abs(userSimiliaritySum);
			candidateResources.put(resource, resourceScore);
		}
		
		if (sorting) {
			// return the sorted resources
			Map<Integer, Double> sortedRankedResources = new TreeMap<Integer, Double>(new DoubleMapComparator(candidateResources));
			sortedRankedResources.putAll(candidateResources);
			return sortedRankedResources;
		} else {
			return candidateResources;
		}
	}