Sample code of the endogenous grid method based on the Fortran code by Barillas and Fernandez Villaverde