scala: week4 more work