First version of main wrapper