Extracting coordinates into a 2d class.