code ready for part 2 post