cleaned up JS and made it a bit DRY-er, some CSS and UI changes