main file split into several and authorship rewritten