public ArrayList<Integer> getFriendsKthLevel(int userID, int k) {

		ArrayList<Integer> friends = new ArrayList<Integer>();

		// Initialize HashMap that stores a boolean (true if node is visited in
		// BFS, false otherwise). In the beginning, no nodes are visited yet.
		HashMap<Integer, Boolean> visited = new HashMap<Integer, Boolean>();

		for (Integer user : data.getUserItemRatings().keySet()) {
			visited.put(user, false);
		}

		HashMap<Integer, Integer> distance = new HashMap<Integer, Integer>();

		LinkedList<Integer> queue = new LinkedList<Integer>();

		for (Integer friend : data.getUserFriends().get(userID)) {
			queue.offer(friend);
			distance.put(friend, 1);
		}

		while (!queue.isEmpty()) {
			int currentNode = queue.poll();
			friends.add(currentNode);
			visited.put(currentNode, true);
			// Only go further if distance is smaller than maximal distance k
			if (distance.get(currentNode) < k) {
				for (Integer friend : data.getUserFriends().get(currentNode)) {
					if (!queue.contains(friend) && visited.get(friend) == false && friend != userID) {
						queue.offer(friend);
						distance.put(friend, distance.get(currentNode) + 1);
					}
				}
			}
		}

		return friends;
	}