first version without any changes from book