Completed UI and Logic