public void animate(float fraction) {

        System.out.println("in animate" + moveX);
        if(moveX > GameConfig.windowXSize || moveY > (GameConfig.leftBoxY + GameConfig.barYSize/2) || moveX < GameConfig.leftBoxX/2 || moveY<0 ){
            timer.stop();
            removeThisMatche();
            return;
        }
        float animationFactor;
        if (linear) {
            animationFactor = fraction;
        } else {
            // Our "nonlinear" motion just uses a sin function to get a
            // simple bounce behavior
            animationFactor = (float) Math.sin(fraction * (float) Math.PI / 2);
        }
        // Clamp the value to make sure it does not exceed the bounds
        animationFactor = Math.min(animationFactor, 1.0f);
        animationFactor = Math.max(animationFactor, 0.0f);
        Map basketCoords = GameConfig.basketCoordinates.get(this.color);
        System.out.println("user id is " + session.getCurrentUser().getId());
        moveX = moveX + (int) (.5f + animationFactor * (float) ((Integer)basketCoords.get("x") - moveMinX));
        moveY = moveY + (int) (.5f + animationFactor * (float) ((Integer)basketCoords.get("y") - moveMinY));
        System.out.println("select matches=" + moveX);
        Point position = new Point(moveX, moveY);
        setLocation(position);
        // The move animation will calculate a location based on a linear
        // interpolation between its start and end points using the fraction
        // redisplay our component with the new animated values
        repaint();
    }