Pack iterative Lasso into a function

The main code for iterative Lasso was packed into a function.