Adding dependencies sorting