public void mouseReleased(MouseEvent e) {
			if(freezeboard)
				return;
			if(board.isGoalState())
			{
				JOptionPane.showMessageDialog(null, "You won!");
				freezeboard=true;
			}
			int modifier = (int) Math.floor(Point.distance(pressed.x,pressed.y,e.getX(),e.getY())/114);
			for(int i=0; i<board.numberOfPieces(); i++){
				//System.out.println(Math.ceil(Point.distance(pressed.x,pressed.y,e.getX(),e.getY())/(board.get(i).length()*114)));
				modifier = (int) Math.ceil(Point.distance(pressed.x,pressed.y,e.getX(),e.getY())/(board.get(i).length()*114));
    			if(board.get(i).bounds().contains(pressed)){
    				if(board.get(i).direction() == Piece.HORIZONTAL){
    					if(board.get(i).whichSideClicked(pressed) == Piece.LEFT){
    						board.moveHorizontal(board.get(i), -modifier);
    					}else{
    						board.moveHorizontal(board.get(i), modifier);
    					}
    				}else{
    					if(board.get(i).whichSideClicked(pressed)==Piece.UP){
    						board.moveVertical(board.get(i), modifier);
    					}else{
    						board.moveVertical(board.get(i), -modifier);
    					}
    				}
    			}
			}
			pressed = new Point();
			repaint();	
		}