to adj matrix