public void setElement(int userId, double rating){
		int beginIndex = 0, halfIndex = 0, endIndex = userIds.length;
		if(userIds.length > 0){
			while(true){
				halfIndex = (endIndex - beginIndex) / 2 + beginIndex;
				if(userId < userIds[halfIndex]){
					if(endIndex - beginIndex <= 1){
						break;
					}
					endIndex = halfIndex;	
				}else if(userId > userIds[halfIndex]){
					if(endIndex - beginIndex <= 1){
						halfIndex++;
						break;
					}
					beginIndex = halfIndex;
				}else{
					ratings[halfIndex] = rating;
					return;
				}
			}
		}
		int[] newUserIds = new int[userIds.length + 1];
		double[] newRatings = new double[ratings.length + 1];
		System.arraycopy(userIds, 0, newUserIds, 0, userIds.length);
		newUserIds[halfIndex] = userId;
		System.arraycopy(userIds, halfIndex, newUserIds, halfIndex + 1, userIds.length - halfIndex);
		System.arraycopy(ratings, 0, newRatings, 0, ratings.length);
		newRatings[halfIndex] = rating;
		System.arraycopy(ratings, halfIndex, newRatings, halfIndex + 1, ratings.length - halfIndex);
		userIds = newUserIds;
		ratings = newRatings;
	}