private void order(String order, String location,
			List<ServiceRequest> requests) {
		if (order != null) {
			if (order.equals("popular")) {
				Collections.sort(requests, new Comparator<ServiceRequest>() {

					@Override
					public int compare(ServiceRequest sr1, ServiceRequest sr2) {
						if (sr1.getVotes() == sr2.getVotes()) {
							return 0;
						} else if (sr1.getVotes() > sr2.getVotes()) {
							return -1;
						} else {
							return 1;
						}
					}
				});
			} else if (order.equals("location")) {
				if (location != null && !location.trim().equals("")) {
					String[] coords = location.split(",");
					final GeoPoint current = new GeoPoint(
							Double.parseDouble(coords[0]),
							Double.parseDouble(coords[1]));
					// for (int i = 0; i < requests.size(); i++) {
					// GeoPoint gp = new GeoPoint(requests.get(i).getLat(),
					// requests.get(i).getLon());
					// if (Utils.getDistance(current, gp) > 0.5) {
					// requests.remove(i);
					// i--;
					// }
					// }
					Collections.sort(requests,
							new Comparator<ServiceRequest>() {

								@Override
								public int compare(ServiceRequest sr1,
										ServiceRequest sr2) {
									GeoPoint gp1 = new GeoPoint(sr1.getLat(),
											sr1.getLon());
									GeoPoint gp2 = new GeoPoint(sr2.getLat(),
											sr2.getLon());
									double d1 = Utils.getDistance(current, gp1);
									double d2 = Utils.getDistance(current, gp2);
									if (d1 == d2) {
										return 0;
									} else if (d1 > d2) {
										return -1;
									} else {
										return 1;
									}
								}
							});
				}
			}
		}
	}