A square card board of length 2+root of 8 has xcm cut off from each corner in order to make an octagon. Find the value of x and length of each side.