with code for part 2.3.1