added functions to rebuild helper and new pileup formula