build chunk for rmd