part of codes for part 1