Moved UI JavaScript over from CodePen