Better algorithm for generating the assembly version

Improved the dependencies graph