stripped impyramid from code

Implemented reduce and expand functions