Finished part 1, modifying part 2 and part 3