Replaced from book code @Chapter6