implemented topological sort for build pipeline functions to ensure they execute in the proper order