Updated script to have all JS code for the catalog