Code in scala