public int collision(ArrayList<Agent> agents, Coordinate c) {
    	int result = 0 ;
    	// the coordinate is the bottom right position of the agent's circle, so let's use
    	// that to find the center of the circle
    	double br_x = c.get_x() + positions.get(positions.size()-1).get_x();
        double br_y = c.get_y()+ positions.get(positions.size()-1).get_y();
        double center_x =  br_x - p.agent_size;
        double center_y = br_y - p.agent_size;
        
        // now loop through all other agents
        for(Agent a : agents){
        	if(a != this && a != captain){
		        double target_br_x = a.get_pos().get_x();
		        double target_br_y = a.get_pos().get_y();
		        double target_x = target_br_x - p.agent_size;
		        double target_y = target_br_y - p.agent_size;
		        double radius = p.agent_size + 10;
		
		        if (Math.abs(center_x - target_x) < radius && Math.abs(center_y - target_y) < radius) {
		            result++;
		        }
        	}
        }
        return result;
    }