updated inline sample code