write the ui