Almost finished the function addFromCatalog

Need testing and to resolve the problem with the first bin