Cleanup for custom.js

- Cleaned up formatting
- Fixed bug in click event listener for generate button