finished dependencies resolve algorithm