public Bundle planBuilding(int years, double genValue, double greed){
		Building planned = null;
		double profit = 1 - greed; //must generate a minimum amount to be worth building
		
		if (genValue > 0){
			double maxPrice = resources.getValue() + (genValue * years);
			
			for (Factory curr: Factory.samples){
				double currCost = curr.getCost().getValue(); 
				if (currCost <= maxPrice){
					int yearsToBuild = (int) (curr.getCost().minus(resources).getValue() / genValue);
					//curr.updateGuesses();
					double currProfit = curr.getProfitability() * (years-yearsToBuild) - currCost;
					if (currProfit > profit){
						planned = curr;
						profit = currProfit;
					}
				}
			}
		}
		building = planned;
		adjustedProfitability = profit;
		if(planned != null){
			refreshGoal();
			return null;
		}
		else{
			goal = new Bundle(); 
			Bundle temp = resources;
			resources = new Bundle();
			return temp;
		}
		
	}