The origin of the pyramids