update code for chapter 1

Signed-off-by: Cristian Stoica <crististm@gmail.com>