doubles an array element which are equal with x