code transfer to augment.r