dependenciy sorting