public boolean canFit(int[][] piece,Point corner)
	{
		for (int i=0;i<piece.length;i++)
		{
			for (int j=0;j<piece[i].length;j++)
			{
				int bx=corner.getX()+i; //row
				int by=corner.getY()+j; //col
				boolean xInRange=!(bx >= board.length || bx < 0);
				boolean yInRange=!(by < 0 || by >= board[0].length);
				if (!xInRange || !yInRange)
				{
					if (piece[i][j]==1)
					{
						return false;
					}
					continue;
				}
				if (piece[i][j]==1 && board[bx][by]==1)
				{
					//check if pieces will overlap
					return false;
				}
			}
		}
		return true;
	}