sample code in scala