Source code of second chapter