adding scala code