public static Critter getNearestPrey(Critter self, Environment envi){
		synchronized(envi.lock_critter){
		
		List<Critter> critters = getViewableCritters(self, envi);
		if(critters.isEmpty()){
			return null;
		}
		
		Critter closest = null;
		double min = 100000000;
		
			Iterator<Critter> iter = critters.listIterator();
			while(iter.hasNext()){
				Critter temp = iter.next();
				double distance = Math.sqrt(Math.pow(self.getPosition().x - temp.getPosition().x, 2) + 
						Math.pow(self.getPosition().y - temp.getPosition().y, 2));
				if (distance == 0){
					continue;
				}
				if(self.stamina >= (self.stamina_stat/10) && temp.getFood() == 1){ //will eat carn if stamina is too low
					continue;
				}
				if(distance < min){
					min = distance;
					closest = temp;
				}
			}
			
		return closest;
		}
	}