My scala code