making generic version of pileup script