scala code exercises