private void animate(int target_x, int target_y, int duration){
			float time = duration/(float) animate_timestep;
			int steps = (int) time;
			if (steps < time) steps++;
			float dx = (target_x - animate.x)/time,
				  dy = (target_y - animate.y)/time;
			
			try {
				for (int i=0; i<steps; i++){
					animate.x += dx;
					animate.y += dy;
					repaint();
					Thread.sleep(animate_timestep);
				}
			} catch (Exception e){
				System.out.println("Animation failed!!!");
			}
		}