Finished up addcomponent() method