sorting dependencies