cleaned up custom.js code