added pyramid centering. not too efficient though