Implemented makeOrderedLeafList  function