public boolean computeData(String response, double startOfRange, double endOfRange, int numberOfGifts){
		boolean isEndOfRangeReached = false;
		try{
			if(!response.equals(null)){
				Object resultObject = jParser.parse(response);
				JSONObject resultJObject = (JSONObject) resultObject;
				
				JSONArray resultArray = (JSONArray) resultJObject.get("results");
				double lastPriceOfProduct = zapposGetAPIData.getPriceOfLastProductOnPage(resultArray);
				double productPrice = 0.0;
				
				int productId, styleId;
				String productName;
				
				//checks if the price of last product on the page is greater than startRange
				if(lastPriceOfProduct > startOfRange){
					for(Object resultObj: resultArray){
						JSONObject resultJObj = (JSONObject)resultObj;
						productPrice = Double.parseDouble(resultJObj.get("price").toString().substring(1));
						//the map below helps to store unique products in the input list
						int currentPriceCount = getPriceProductCounterMap.containsKey(productPrice)?getPriceProductCounterMap.get(productPrice):0;
						getPriceProductCounterMap.put(productPrice,currentPriceCount+1);
						// unique products can occur as the number of gifts in the input list
						if(getPriceProductCounterMap.get(productPrice)<= numberOfGifts){
							// if price of product is greater than start of range
							if(productPrice >= startOfRange){
								productId = Integer.parseInt(resultJObj.get("productId").toString());
								styleId = Integer.parseInt(resultJObj.get("styleId").toString());
								productName = resultJObj.get("productName").toString();
								Product product = new Product();
								product.setPrice(productPrice);
								product.setProductId(productId);
								product.setStyleId(styleId); 
								product.setProductName(productName);
								//update the map of productId and product data
								getUniqueProductIdMap.put(productId, product);
							}
						}
					}
				}
				//if product price is greater than the range end then stop product collection process.
				if(productPrice > endOfRange){
					isEndOfRangeReached = true;
				}
			}else{
				isEndOfRangeReached = false;
			}
		}catch(Exception e){
			
		}
		return isEndOfRangeReached;
	}