fixes lots of bugs, ands new files generation and dynamic loading