public boolean move(Direction d) {
		Segment s = segments.getFirst();
		Segment snew = new Segment(0, 0);
		boolean doit = true;
		
		switch (d) {
		case UP:
			snew = new Segment(s.posx, s.posy+1);
			break;
		case DOWN:
			snew = new Segment(s.posx, s.posy-1);
			break;
		case LEFT:
			snew = new Segment(s.posx-1, s.posy);
			break;
		case RIGHT:
			snew = new Segment(s.posx+1, s.posy);
			break;
		default:
			doit = false;
			break;
		}
		
		if(doit) {
			segments.addFirst(snew);
			if(food > 0) {
				food--;
			}
			else {
				segments.removeLast();
			}
			return true;
		}
		else {
			return false;
		}
	}