scala code