Cleaned up part 5 and part 6