Added comments to make the GUI code more understandable