public void move(double dx, double dy, Dimensions boundaries) {
        final Coordinate old = get_pos();
        int count = 0;
        Coordinate c = new Coordinate(dy, dx);
        // if we're not the captain, and our next move results in a collision
        // we do something else.
        while(captain != null && collision(g.agents, c) > 0 && count < 10)
        {
        	double r1 = Math.random();
        	double r2 = Math.random();
        	if(r1 > 0.5) dx = -dx;
        	if(r2 > 0.5) dy = -dy;
        	c = new Coordinate(dx, dy);
        	count++;
        }
        c.scale(p.speed);
        c.add(old);
        c.bound(p.agent_size, boundaries);
        positions.add(c);
    }