sample code for headspring