sample code for Richard