Updating code for part 2