Final commit for part 2. Only one bug left now.