what were the two purposes of the pyramids?