public PuzzlePiece setCell(int x, int y, PuzzlePiece piece){
		if(!isValid(x,y)) return null;
		PuzzlePiece tempPiece = getCell(x,y);
		occupied += !isOccupied(x,y)&&piece!=null?1:isOccupied(x,y)&&piece==null?-1:0;
		grid[y][x] = piece;
		return tempPiece;
	}