public static int[] computeBuying(int[] arr) {
		int[] results = { -1, -1, -1 };

		// error check - only one data point
		if (arr.length == 1) {
			results[0] = results[1] = results[2] = 0;
			return results;
		}

		int min = 0;
		int max = 0;
		int prof = 0;

		int tempMin = 0;
		int tempMax = 0;
		int tempProf = 0;

		for (int i = 1; i < arr.length; i++) {

			if (arr[i] > arr[i - 1]) {
				tempMax = i;
				tempProf = arr[tempMax] - arr[tempMin];
			} else if (arr[i] < arr[i - 1]) {
				tempMin = i;
				tempMax = i;
			}

			if (tempProf > prof) {
				max = tempMax;
				min = tempMin;
				prof = tempProf;
			}
		}

		results[0] = min;
		results[1] = max;
		results[2] = prof;

		return results;
	}