Commented most important parts of the UI code