lecture8.R