some scala code