Added some UI logic.