public boolean loadCargo(String good, int goodPrice){
         String goodName = good + "00";           //prevent having same name for multiple slots with a same good type
        if (!theCargoGoods.containsKey(goodName))      //if the good is a new type
        {
             if (isCargoHoldFull())                       //a new type of good need a empty cargo slot
                  return false;                        //if current cargo slots have all been used, can't buy any new type of good
             else                                 //otherwise, there exists at least one empty cargo slot for this new type of good
             {
                  addGoodToNewSlot(goodName, goodPrice);        //load the good to a new empty cargo slot
                  return true;
             }
        }
        else        //if there exists at lease one cargo slot holds same type of good in the spaceship cargo 
        {   
             if(numberOfGoods == maxCapacityOfGoods)
                  return false;         //the spaceship has reach its maximum capacity, can't buy any more good
             else                       //a cargo slot holds the same type of good 
             {
                  //if multiple slots that hold a same type of good, take the newest one
                  while(theCargoGoods.containsKey(goodName) && theCargoGoods.get(goodName).isCurrentSlotFull())
                  {
                       goodName = nameAppend(goodName);
                  }
                  if(theCargoGoods.containsKey(goodName))        //There exists a slot that holds the same type of good, but it is not full
                  {
                        theCargoGoods.get(goodName).addItem(goodPrice);        //load the good into this cargo slot
                        numberOfGoods++;
                        return true;
                  }     
                  else                            //all cargo slots that hold the same type of good are full
                  {
                       if(isCargoHoldFull())          // there is not more empty cargo slot available
                            return false;         //can't buy any more good
                       else                            //there exists at least one empty cargo slot
                       {
                            addGoodToNewSlot(goodName, goodPrice);        //load the good to a new empty cargo slot
                            return true;
                       }
                  }
             }
        }
    }