Some scala learning code