fix coordinates and indices