public double getRatingForUser(int userId){
		int beginIndex = 0, halfIndex, endIndex = userIds.length;
		if(userIds.length > 0){
			while(true){
				halfIndex = (endIndex - beginIndex) / 2 + beginIndex;
				if(userId < userIds[halfIndex]){
					if(endIndex - beginIndex <= 1){
						return -1.0;
					}
					endIndex = halfIndex;
				}else if(userId > userIds[halfIndex]){
					if(endIndex - beginIndex <= 1){
						return -1.0;
					}
					beginIndex = halfIndex;
				}else{
					return ratings[halfIndex];
				}
			}
		}else{
			return -1.0;
		}
	}