Refactor simple assignment from book

It is now scalable