First stable commit of main and sub-functions