Finished source for part 2