Added code for the pyramid2 function.  Currently untested.