Example code to problem1. Some clarifications