cleaned up code added catalog.js