Added a lot of UI code