copy from course project
improve the UI