output dependencies in the correct order