Add scala code to mainline