Final version for part 1