Pyramids in a cosmic view