final version for part 1