R and D sample code