All of part 1 except for the file stuff, some of part 2