Cleaned up ui.js
Cleaned up ui.js