tested dynamic methodology

the new main file have been completely tested, minor changes