reorganizes for prism to appear first, then the resultant table