add assignment 8 + better version of UI.r for #7