Pack things into function

The main code was packed into a function.
Full code

This version contains all code for iterative Lasso, without any
function, which is easier to debug.