Added beginning of UI code.