More code for Main

Still not there, in fact far from it.

Signed-off-by: Francis Galiegue <fgaliegue@gmail.com>