make the pyramid code nicer to look at
small fixes
pyramid code
minor changes